feat: add job.workflow_* context properties#348
Merged
Conversation
Add workflow_ref, workflow_sha, workflow_repository, and workflow_file_path to the job context for reusable workflow jobs. These fields provide direct access to the workflow file information without needing to parse github.workflow_ref. - Add 4 new fields to getJobContext() in job.ts - Add descriptions in descriptions.json - Update autocomplete test expectations - Add validation and unit tests
Contributor
There was a problem hiding this comment.
Pull request overview
Adds language-service support for four new job context properties (workflow_ref, workflow_sha, workflow_repository, workflow_file_path) so validation and autocomplete recognize reusable-workflow runtime-populated workflow metadata.
Changes:
- Extend
jobcontext provider to include fourworkflow_*string fields with descriptions. - Add/extend unit tests to assert field presence, expression validation, and completion suggestions.
- Add human-readable descriptions for the new context keys.
Show a summary per file
| File | Description |
|---|---|
| languageservice/src/context-providers/job.ts | Adds job.workflow_* fields to the job context dictionary. |
| languageservice/src/context-providers/descriptions.json | Adds descriptions for the new job.workflow_* fields. |
| languageservice/src/context-providers/job.test.ts | Verifies the new fields and their descriptions are present in the job context. |
| languageservice/src/validate.expressions.test.ts | Validates expressions referencing the new job.workflow_* fields produce no diagnostics. |
| languageservice/src/complete.expressions.test.ts | Updates completion expectations to include the new job.workflow_* keys. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 4
ericsciple
previously approved these changes
Apr 14, 2026
…iption wording - Update getJobContext doc comment to include workflow identity fields - Rename test to reflect all returned fields, not just status/check_run_id - Rename validate test to 'job.workflow_* fields' covering all 4 properties - Clarify workflow_ref description: 'ref path to' instead of 'ref of'
rentziass
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds four new properties to the
jobcontext for language service support:job.workflow_ref— The ref path to the workflow file (e.g.,octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch)job.workflow_sha— The commit SHA of the workflow filejob.workflow_repository— The owner and repository name of the workflow file (e.g.,octocat/Hello-World)job.workflow_file_path— The path of the workflow file (e.g.,.github/workflows/my-workflow.yml)These fields are populated at runtime for reusable workflow jobs and provide direct access to workflow file information without needing to parse
github.workflow_ref.Changes
job.tsdata.StringDatafields with descriptionsdescriptions.jsonjob.test.tsvalidate.expressions.test.tscomplete.expressions.test.tsRelated PRs
job.workflow_*typed accessors to JobContext runner#4335Testing